<?php
$Url = $_POST['url'];
$site = $_POST['site'];
$action = $_POST['action'];

if($action == 'requesttoken'){
	$result = file_get_contents($Url);
	$rs = explode("&", $result);
	$ret = array();
	foreach ($rs as $r){
		$rr = explode("=", $r);
		$ret[$rr[0]] = $rr[1];
	}
	echo json_encode($ret);
}elseif ($action == 'normal'){
	echo  file_get_contents($Url);
}
?>